const API = require('../../pages/api/index')
const { typeJson } = require('../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))


Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    listConfig: [
      {
        label: "发现时间",
        prop: "discoverDate",
      
      },
      {
        label: "隐患部位",
        prop: "part",
      },
      ],
      slide: {
        slideButton: {
         
          type: 'warn',
          text: '复查',
          extClass: 'test',
            src: '/page/weui/cell/icon_star.svg', // icon的路径
        },
        formConfig: [
          {
            label: '复查结果',
            prop: 'reviewStatus',
            type: 'dropDown',
            jsonType: typeJson.reviewStatus,
            required:true,
        },
  
       
   
        {
            label: '复查意见',
            prop: 'reviewOpinion',
         
        },
        {
            label: '复查时间',
            prop: 'reviewDate',
            type: 'date',
            required:true,
        },
        {
          label: '',
          prop: 'reviewManSign',
          type: 'canvas', 
        },
      

        ]
      },
 
      formConfig: [
        {
          label: "复查人",
          prop: "reviewManId",
          tag:"userid",
          hidden:"all"
      },
        {
          label: "隐患描述",
          type:"textarea",
          prop: "content",
          hidden:"edit"
        },
        {
          label: "来源",
          prop: "source", 
          jsonType:typeJson.source,
          type: "dropDown",
          hidden:"edit"
          
        },
        {
          label: "隐患部位",
          prop: "part",
          hidden:"edit"
        },
        {
          label: "隐患级别",
          prop: "level",
          type: "dropDown",
          jsonType: typeJson.level,
          hidden:"edit"
        },
       
        {
          label: "发现人",
          prop: "discoverPerson",
          hidden: 'edit',
        },
        {
          label: "核查人",
          prop: "verifyManId",
          type: 'dropDownSearch',
          hidden: 'edit',
          net: {
            url: '/app/memberinfo/getList',
            method: 'post',
            key: 'nickName',
            data:{
              mineId: true,
            },
            value: 'memberId'
          }
        },
        {
          label: "发现时间",
          prop: "discoverDate",
          type:"date",
          hidden:"edit"

        },
        {
          label: "复查时间",
          prop: "reviewDate",
          type:"date",
          hidden:"edit"
        },
        {
          label: "复查人",
          prop: "reviewMan",
          hidden:"edit"
         
        },
        {
          label: "复查状态",
          prop: "reviewStatus",
          type: "dropDown",
          jsonType: typeJson.reviewStatus,
          hidden:"edit"
        
        },

        {
          label: '复查结果',
          prop: 'reviewStatus',
          type: 'dropDown',
          jsonType: typeJson.reviewStatus,
          required:true,
      },

     
 
      {
          label: '复查意见',
          prop: 'reviewOpinion',
       
      },
      {
          label: '复查时间',
          prop: 'reviewDate',
          type: 'date',
          required:true,
      },
       
        
       


     
       
      
        ],
    
        
        net: {
       
            select: {
              url: `/app/riskExcludeNew/getList`,
              method: 'post',
              data: {
                mineId: true,
                checkType: 4
              }
            },
            delete: {
              url: '/app/riskExcludeNew/delete',
              method: 'get',
              data: {
                
              }
            },
            insert: {
              url: '/app/riskExcludeNew/insert',
              method: 'post',
              data: {
                mineId:true,
                discoverManId:"userid",
               
              }
            },
            update: {
              url: '/app/riskExcludeNew/update',
              method: 'post',
              data: {
  
              }
            }
  
          
        },
        showCom:true
      },

     
  

  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
   
    this.setData({
      showCom: false
    });
    this.setData({
      showCom: true
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})